<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn {
            position: absolute;
            top: 0;
            left: 5px;
        }

        img {
            width: 100px;
        }
    </style>
</head>

<body>
    <div class="box">
        <button class="btn">×</button>
        <img src="images/er.webp" alt="">
    </div>
    <script>
        var btn = document.querySelector('.btn');
        var box = document.querySelector('.box');
        btn.onclick = function () {
            box.style.display = 'none';
        }
    </script>
</body>

</html>